package com.juzipi.common.constant.properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 静态变量注入配置文件的值
 */

@Component
public class PropertiesVariable {

    //注意@Value不能给静态变量赋值,有的参数是静态变量
    public static long userTimesLock;//多少次锁定

    public static long userPeriodTime;//在一定时间区间内

    public static long userLockTime;//锁定多少时间

    //用set给它赋值
    @Value(value = "${locked.lockTime}")
    public void setTimesLock(long timesLock){
        userTimesLock = timesLock;
    }

    @Value(value = "${locked.periodTime}")
    public void setPeriodTime(long periodTime){
        userPeriodTime = periodTime;
    }

    @Value(value = "${locked.lockTime}")
    public void setLockTime(long lockTime){
        userLockTime = lockTime;
    }

}
